\begin{algorithm}
\caption{FatNodeTransComp($G$,$t$)}
\label{alg:FatNodeTransComp}
\begin{algorithmic}[1]
\REQUIRE{DAG $G=(V,E)$}
\REQUIRE{$t$: a threshold for determine the fat-node}
\STATE $L_r \leftarrow \emptyset; L_f \leftarrow \emptyset$ \\
\COMMENT{Step 1:} \\
\STATE Topologically sort $G$ \\
\COMMENT{Step 2: (Traverse all vertices in the reverse topological
order $n\rightarrow 1$)} \\ 
\FOR{$u=n$ to $1$} 
\FORALL{$v \in out(u)$}
    \STATE $R_f(u) \leftarrow R_f(u) \cup R_f(v)$ \\
    \IF{$v \in L_f(v)$} 
        \STATE $R_f(u) \leftarrow R_f(u) \cup \{v\}$ \COMMENT{$v$ is a fat-node}
    \ELSE 
        \STATE $R_r(u) \leftarrow R_r(u) \cup R_r(v) \cup \{v\}$ \COMMENT{$v$ is a regular vertex}
    \ENDIF
    \IF{$|R_r(u)|+|R_f(u)| \geq t$} 
        \STATE $L_f \leftarrow L_f \cup \{u\}$ \COMMENT{$u$ is a fat-node} 
    \ELSE 
        \STATE $L_r \leftarrow L_r \cup \{u\}$ \COMMENT{$u$ is a regular vertex}
    \ENDIF
\ENDFOR
\ENDFOR \\
\COMMENT{Step 3: Traverse the fat-node list $L_f$} 
\FORALL{$u \in L_f$}
    \STATE $\forall v \in R_r(u), S_f(v) \leftarrow S_f(v) \cup \{u\}$ 
\ENDFOR 
\end{algorithmic}
\end{algorithm}